package com.rd.sys.service.analysis.statistic;

import java.util.List;

import com.rd.sys.dto.client.store.EventModel;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import baseproj.common.mybatis.page.PageParameter;

import com.rd.sys.dto.client.data.GazeData;
import com.rd.sys.dto.client.store.Material;
import com.rd.sys.dto.client.store.Result;
import com.rd.sys.dto.client.store.Scheme;
import com.rd.sys.dto.client.store.statistic.StatisticFixationData;
import com.rd.sys.dto.client.store.statistic.StatisticSaccadeData;
import com.rd.sys.dto.client.store.statistic.TempIndex;

public interface StatisticService {

    /**
     * 查询注视点统计数据
     *
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param resultCode
     * @param materialCode
     * @param page
     * @return
     */
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public List<StatisticFixationData> queryFixationDataList(String userCode, String projectCode, String schemeCode,
                                                             String resultCode, String materialCode, PageParameter page) throws Exception;

    /**
     * 查询扫视点统计数据
     *
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param resultCode
     * @param materialCode
     * @param page
     * @return
     */
    public List<StatisticSaccadeData> querySaccadeDataList(String userCode, String projectCode, String schemeCode,
                                                           String resultCode, String materialCode, PageParameter page) throws Exception;

    /**
     * 查询素材统计数据
     *
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param resultCode
     * @param materialCode
     * @param page
     * @return
     */
    public List<Material> queryMaterialDataList(String userCode, String projectCode, String schemeCode,
                                                String resultCode, String materialCode, PageParameter page) throws Exception;

    /**
     * 查询结果统计数据
     *
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param resultCode
     * @param page
     * @return
     * @throws Exception
     */
    public List<Result> queryResultDataList(String userCode, String projectCode, String schemeCode, String resultCode,
                                            PageParameter page) throws Exception;

    /**
     * 查询事件统计的结果数据
     *
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param resultCode
     * @param page
     * @return java.util.List<com.rd.sys.dto.client.store.EventModel>
     * @title 》queryEventDataList
     * @author admin
     * @date 2019-12-30 13:14
     * @since v1.0.1
     **/
    List<EventModel> queryEventDataList(String userCode, String projectCode, String schemeCode, String resultCode,
                                        PageParameter page) throws Exception;

    /**
     * 从注视点数据文件中加载注视点统计信息
     *
     * @param key
     * @return
     * @throws Exception
     */
    public List<StatisticFixationData> readFixationDataList(String key) throws Exception;

    /**
     * 从扫视点数据文件中加载扫视点统计信息
     *
     * @param key
     * @return
     * @throws Exception
     */
    public List<StatisticSaccadeData> readSaccadeDataList(String key) throws Exception;

    /**
     * 对下一个GazeData进行判断,看是否生成注视点
     *
     * @param alreadyFixStatList
     * @param waitGazeData
     * @param currentScheme
     * @param materialIndex
     * @param baseTime
     * @param currentResult
     * @return
     */
    public StatisticFixationData judgeStatisticFixationData(List<GazeData> alreadyFixStatList, GazeData waitGazeData,
                                                            Scheme currentScheme, TempIndex materialIndex, Long baseTime,
                                                            Result currentResult,List<EventModel> eventModels) throws Exception;

    /**
     * 根据已有的GazeDate数据集,生成新的统计注视点信息
     *
     * @param alreadyFixStatList
     * @param currentScheme
     * @param currentMaterial
     * @param currentResult
     * @param baseTime
     * @return
     */
    public StatisticFixationData calcStatisticFixationData(List<GazeData> alreadyFixStatList, Scheme currentScheme,
                                                           Material currentMaterial, Result currentResult, long baseTime) throws Exception;

    /**
     * 对下一个GazeData进行判断,看是否生成扫视点
     *
     * @param alreadySacStatList
     * @param waitGazeData
     * @param currentScheme
     * @param materialIndex
     * @param baseTime
     * @param currentResult
     * @return
     */
    public StatisticSaccadeData judgeStatisticSaccadeData(List<GazeData> alreadySacStatList, GazeData waitGazeData,
                                                          Scheme currentScheme, TempIndex materialIndex, Long baseTime, Result currentResult, List<EventModel> eventModels) throws Exception;

    /**
     * 根据已有的GazeDate数据集,生成新的统计扫视点信息
     *
     * @param alreadySacStatList
     * @param currentScheme
     * @param currentMaterial
     * @param currentResult
     * @param baseTime
     * @return
     */
    public StatisticSaccadeData calcStatisticSaccadeData(List<GazeData> alreadySacStatList, Scheme currentScheme,
                                                         Material currentMaterial, Result currentResult, long baseTime) throws Exception;
}
